package cn.com.dao;

import cn.com.pojo.CommentBean;
import cn.com.pojo.FoodBean;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import javax.annotation.Resource;
import java.util.List;

public interface FoodBeanMapper {
    @Select("SELECT COUNT(*) FROM t_food")
    public int countAll();

    @Select("select * from t_food")
    public List<FoodBean> findAll();
    @Select("select * from t_food where id=#{id}")
    public FoodBean findAllById(Integer id);
    @Select("select price from t_food where id=#{id}")
    public FoodBean findPriceById(Integer id);

    @Select("select comment from t_comments where id=#{id}")
    public CommentBean findCommentById(Integer id);
    @Insert("insert into t_comments values(null,#{foodid},#{userid},#{comment},#{postdate})")
    public int add(CommentBean comment);
}
